Optimal. Leaf size=38 \[ \frac {2 \sqrt {a} \sinh ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {3886, 221}
\begin {gather*} \frac {2 \sqrt {a} \sinh ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 221
Rule 3886
Rubi steps
\begin {align*} \int \sqrt {-\sec (e+f x)} \sqrt {a-a \sec (e+f x)} \, dx &=\frac {2 \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{a}}} \, dx,x,\frac {a \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 \sqrt {a} \sinh ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.93, size = 299, normalized size = 7.87 \begin {gather*} \frac {\csc \left (\frac {1}{2} (e+f x)\right ) \left (-2 i \text {ArcTan}\left (\frac {\cos \left (\frac {1}{4} (e+f x)\right )-\left (-1+\sqrt {2}\right ) \sin \left (\frac {1}{4} (e+f x)\right )}{\left (1+\sqrt {2}\right ) \cos \left (\frac {1}{4} (e+f x)\right )-\sin \left (\frac {1}{4} (e+f x)\right )}\right )+2 i \text {ArcTan}\left (\frac {\cos \left (\frac {1}{4} (e+f x)\right )-\left (1+\sqrt {2}\right ) \sin \left (\frac {1}{4} (e+f x)\right )}{\left (-1+\sqrt {2}\right ) \cos \left (\frac {1}{4} (e+f x)\right )-\sin \left (\frac {1}{4} (e+f x)\right )}\right )-4 \tanh ^{-1}\left (\sqrt {2} \cos \left (\frac {1}{4} (2 e+f x)\right ) \sec \left (\frac {f x}{4}\right )+\tan \left (\frac {f x}{4}\right )\right )+\log \left (2-\sqrt {2} \cos \left (\frac {1}{2} (e+f x)\right )-\sqrt {2} \sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (2+\sqrt {2} \cos \left (\frac {1}{2} (e+f x)\right )-\sqrt {2} \sin \left (\frac {1}{2} (e+f x)\right )\right )\right ) \sqrt {a-a \sec (e+f x)}}{2 \sqrt {2} f \sqrt {-\sec (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(123\) vs.
\(2(32)=64\).
time = 0.21, size = 124, normalized size = 3.26
method | result | size |
default | \(\frac {\left (\arctanh \left (\frac {\sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \left (1+\cos \left (f x +e \right )-\sin \left (f x +e \right )\right )}{2}\right )+\arctanh \left (\frac {\sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \left (1+\cos \left (f x +e \right )+\sin \left (f x +e \right )\right )}{2}\right )\right ) \cos \left (f x +e \right ) \sqrt {-\frac {1}{\cos \left (f x +e \right )}}\, \sqrt {\frac {a \left (-1+\cos \left (f x +e \right )\right )}{\cos \left (f x +e \right )}}}{f \sin \left (f x +e \right ) \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}}\) | \(124\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 385 vs.
\(2 (34) = 68\).
time = 0.59, size = 385, normalized size = 10.13 \begin {gather*} -\frac {\sqrt {a} {\left (\log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right ) + \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right )\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 97 vs.
\(2 (34) = 68\).
time = 2.62, size = 233, normalized size = 6.13 \begin {gather*} \left [\frac {\sqrt {a} \log \left (\frac {4 \, {\left (\cos \left (f x + e\right )^{3} + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right )\right )} \sqrt {a} \sqrt {\frac {a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{\cos \left (f x + e\right )}} + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) + 8 \, a\right )} \sin \left (f x + e\right )}{\cos \left (f x + e\right )^{2} \sin \left (f x + e\right )}\right )}{2 \, f}, -\frac {\sqrt {-a} \arctan \left (\frac {2 \, {\left (\cos \left (f x + e\right )^{2} + \cos \left (f x + e\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{\cos \left (f x + e\right )}}}{{\left (a \cos \left (f x + e\right ) + 2 \, a\right )} \sin \left (f x + e\right )}\right )}{f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {- \sec {\left (e + f x \right )}} \sqrt {- a \left (\sec {\left (e + f x \right )} - 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 98 vs.
\(2 (32) = 64\).
time = 0.80, size = 98, normalized size = 2.58 \begin {gather*} \frac {\sqrt {2} {\left (\frac {\sqrt {2} a^{2} \arctan \left (\frac {\sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}}{2 \, \sqrt {-a}}\right )}{\sqrt {-a}} - \frac {\sqrt {2} a^{2} \arctan \left (\frac {\sqrt {a}}{\sqrt {-a}}\right )}{\sqrt {-a}}\right )} {\left | a \right |} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{a^{2} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \sqrt {a-\frac {a}{\cos \left (e+f\,x\right )}}\,\sqrt {-\frac {1}{\cos \left (e+f\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________